import { createRouter, createWebHashHistory } from 'vue-router'


const routes = [
    {
        path: '/',
        name: 'home',
        component: () => import('../views/home.vue'),
        redirect: '/index',  // 重定向:重新指向其它path,会改变网址
        children: [
            {
                path: 'index',
                component: () => import('../views/home/index.vue'),
            },
            {
                path: 'course',
                component: () => import('../views/home/course.vue'),
            },
            {
                path: 'record',
                component: () => import('../views/home/record.vue'),
            },
            {
                path: 'practice',
                component: () => import('../views/home/practice.vue'),
            },
            {
                path: 'my',
                component: () => import('../views/home/my.vue'),
            },
        ],
    },
    {
        path: "/note",
        component: () => import('../views/my/note.vue')
    },
    {
        path: "/set",
        component: () => import('../views/my/set.vue')
    },
    {
        path: "/password",
        component: () => import('../views/my/password.vue')
    },
    {
        path: "/setPassword",
        component: () => import('../views/my/setPassword.vue')
    }

]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router
